<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<%@ page session="true"%>
<%@ page import="javax.portlet.*"%>
<%@ taglib uri="http://java.sun.com/portlet" prefix="portlet"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>

<portlet:defineObjects />

<html>
<script type="text/javascript">
    function getForm(namespace, name) {
        return document.forms[namespace + name];
    }

    function submitForm(namespace, name, action, page) {
        var frm = getForm(namespace, name);
        frm.txtAction.value = action;
        frm.submitLink.value = page;
        frm.submit();
    }
</script>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Personal Information Tracking System</title>
<meta name="keywords" content="" />
<meta name="description" content="" />

<script type="text/javascript"
	src='<%=renderRequest.getContextPath() + "/js/calendarDateInput.js" %>'></script>
<script type="text/javascript"
	src='<%=renderRequest.getContextPath() + "/js/simpletreemenu.js" %>'>
/***********************************************
* Simple Tree Menu- Â© Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/
</script>

<link rel="stylesheet" type="text/css" href="style/simpletree.css" />
<link href="style/style.css" rel="stylesheet" type="text/css"
	media="screen" />
</head>

<body>
<form name="<portlet:namespace/>myForm" action="<portlet:actionURL/>"
	method="POST"><input type="hidden" name="txtAction" /> <input
	type="hidden" name="submitLink" />
<p align="right">You are logging in as <a href="#"
	onclick="submitForm('<portlet:namespace/>', 'myForm', 'editEmployeeInfo')"><b>${sessionScope.userName}</b></a>
! &nbsp; <a href="#"
	onclick="submitForm('<portlet:namespace/>', 'myForm', 'home')">Home</a>
| &nbsp; <a href="#"
	onclick="submitForm('<portlet:namespace/>', 'myForm', 'logout')">Logout</a>
</p>
</form>

<form name="<portlet:namespace/>editEmployeeInfoForm"
	action="<portlet:actionURL/>" method="post"><input type="hidden"
	name="txtAction" /> <input type="hidden" name="submitLink" /> <br>
<table align="center">
	<tr class="title">
		<td>
		<h1><a href="#">Personal Information</a></h1>
		<hr>
		</td>
	</tr>
	<tr>
		<td>
		<h4 align="center">${sessionScope.successMess}
		${sessionScope.errorMess}</h4>
		</td>
	</tr>
	<tr>
		<td>
		<table border="1" width="100%">
			<tr>
				<td align="left" valign="middle">Name</td>
				<td align="left" valign="middle"><input width="100%"
					type="text" name="txtName" value="${sessionScope.employee.name}" />
				</td>
			</tr>
			<tr>
				<td align="left" valign="middle">Birthdate&nbsp;&nbsp;&nbsp;&nbsp;</td>
				<td align="left" valign="middle"><script>
					DateInput('txtBirthday', true, 'DD-MM-YYYY', '<%= request.getContextPath() %>', '${sessionScope.employee.birthday}');
					//DateInput('txtBirthday', true, 'DD-MM-YYYY', '${sessionScope.employee.birthday}');
				</script> <%--input width="100%" type="text" name="txtBirthday" value="${sessionScope.employee.birthday}"/--%>
				</td>
			</tr>
			<tr>
				<td align="left" valign="middle">Address</td>
				<td align="left" valign="middle"><input width="100%"
					type="text" name="txtAddress"
					value="${sessionScope.employee.address}" /></td>
			</tr>
			<tr>
				<td align="left" valign="middle">Phone</td>
				<td align="left" valign="middle"><input width="100%"
					type="text" name="txtPhone" value="${sessionScope.employee.phone}" />
				</td>
			</tr>
			<tr>
				<td align="left" valign="middle">Email</td>
				<td align="left" valign="middle"><input width="100%"
					type="text" name="txtEmail" value="${sessionScope.employee.email}" />
				</td>
			</tr>
			<tr>
				<td align="left" valign="middle">Gender</td>
				<td align="left" valign="middle"><select name="txtGender">
					<option id="o1" value="0">Male</option>
					<option id="o2" value="1">Female &nbsp;&nbsp;</option>
				</select> <script type="text/javascript">
					var gd = "${sessionScope.employee.gender}";
					if (gd == "0") {
						document.getElementById("o1").setAttribute("selected", "true");
					} else {
						document.getElementById("o2").setAttribute("selected", "true");
					}
				</script></td>
			</tr>
		</table>
		</td>
	</tr>
	<tr>
		<td>&nbsp;</td>
	</tr>
	<tr>
		<td><input type="button" value="Update"
			onclick="submitForm('<portlet:namespace/>', 'editEmployeeInfoForm',
											'confirm', 'EditEmployeeInfo.jsp')" />
		&nbsp;&nbsp;&nbsp; <input type="button" value="Cancel"
			onclick="submitForm('<portlet:namespace/>', 'editEmployeeInfoForm',
											'cancel', 'EditEmployeeInfo.jsp')" />
		</td>
	</tr>
</table>
</form>
</body>
</html>